<?php

namespace LowCode\Naive;

use LowCode\Naive;
use LowCode\Support\JsExp;
use LowCode\Traits\Props\HasLabel;
use LowCode\Traits\Props\HasValue;
use LowCode\Traits\Slots\HasSlotLabel;
use LowCode\Traits\Slots\HasSlotPrefix;
use LowCode\Traits\Slots\HasSlotSuffix;

/**
 * Statistic 统计数据组件
 * @method static Statistic make(string|int|JsExp $value = null) Statistic组件
 */
class Statistic extends Naive
{
    use HasLabel, HasValue;

    use HasSlotLabel, HasSlotPrefix, HasSlotSuffix;

    /**
     * @param string|int|JsExp|null $value
     */
    public function __construct(string|int|JsExp $value = null)
    {
        parent::__construct();
        $this->value($value);
    }

    /**
     * 是否让数字等宽
     * @param string|bool $bool
     * @return $this
     */
    public function tabularNums(bool|JsExp $bool = true): static
    {
        return $this->prop('tabularNums', $bool);
    }


}
